<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8" />
		<title>登录页面</title>
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<link href="/css/bootstrap.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="/css/font-awesome.min.css" />
		<link rel="stylesheet" href="/css/ace.min.css" />
		<link rel="stylesheet" href="/css/ace-rtl.min.css" />
		<script type="text/javascript">
		function change() {
	        document.getElementById("img").src = "/getCode";
	    }
		function check_number(){
			$.post("/validateCode",{
	             inputCode:$("#code").val(),
	         },function(data,status){
	             if(data=="false"){
	                 $("#result").html("×");    
	             }else if(data=="true"){
	                 $("#result").html("√");
	             }
	         });
		}
		function login(){
			$.post("/toAdminLogin",{
				username:$("#l_username").val(),
				password:$("#l_password").val(),
	         },function(data,status){
	        	 if(data.message=="登录成功"){
	        		 alert("登录成功！");
	        		 location.href = "/admin/index.html";
	             }else{
	            	 alert(data.status+data.message);
	             }
	             
	         });
		}
		</script>
	</head>

	<body class="login-layout">
		<div class="main-container">
			<div class="main-content">
				<div class="row">
					<div class="col-sm-10 col-sm-offset-1">
						<div class="login-container">
							<div class="center">
								<h1>
									<i class="icon-leaf green"></i>
									<span class="red">慈善</span>
									<span class="white">图书后台管理系统</span>
								</h1>
								<h4 class="blue">&copy; Charity Book</h4>
							</div>

							<div class="space-6"></div>

							<div class="position-relative">
								<div id="login-box" class="login-box visible widget-box no-border">
									<div class="widget-body">
										<div class="widget-main">
											<h4 class="header blue lighter bigger">
												<i class="icon-coffee green"></i>
												请输入账号密码
											</h4>

											<div class="space-6"></div>

												<fieldset>
													<label class="block clearfix">
														<span class="block input-icon input-icon-right">
															<input type="text" class="form-control" placeholder="账号" name="username" id="l_username"/>
															<i class="icon-user"></i>
														</span>
													</label>

													<label class="block clearfix">
														<span class="block input-icon input-icon-right">
															<input type="password" class="form-control" placeholder="密码" name="password" id="l_password"/>
															<i class="icon-lock"></i>
														</span>
													</label>

													<div class="space"></div>

													<div class="clearfix">

														<button id="tologin" onclick="login()" type="button" class="width-35 pull-right btn btn-sm btn-primary">
															<i class="icon-key"></i>
															登录
														</button>
													</div>

													<div class="space-4"></div>
												</fieldset>
										</div><!-- /widget-main -->


									</div><!-- /widget-body -->
								</div><!-- /signup-box -->
							</div><!-- /position-relative -->
						</div>
					</div><!-- /.col -->
				</div><!-- /.row -->
			</div>
		</div><!-- /.main-container -->


		<script src='/js/jquery-2.0.3.min.js'></script>
		<script src='/js/jquery.mobile.custom.min.js'></script>

		<!-- inline scripts related to this page -->

		<script type="text/javascript">
			function show_box(id) {
			 jQuery('.widget-box.visible').removeClass('visible');
			 jQuery('#'+id).addClass('visible');
			}
		</script>
</body>
</html>
